package cn.xiaosiyuan.example.filterMessageExample;

import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.remoting.common.RemotingHelper;

public class ProducerExample {

    public static void main(String[] args) {

        // 发送消息时，你能通过putUserProperty来设置消息的属性
/*

        DefaultMQProducer producer = new DefaultMQProducer("please_rename_unique_group_name");
        producer.start();
        Message msg = new Message("TopicTest",
                tag,
                ("Hello RocketMQ " + i).getBytes(RemotingHelper.DEFAULT_CHARSET)
        );
        // 设置一些属性
        msg.putUserProperty("a", String.valueOf(i));
        SendResult sendResult = producer.send(msg);

        producer.shutdown();

*/
    }

}
